
public class Bicycle {
	private int gears;
	private int speed;
	private int currentGear;
	
	public Bicycle(int inGears) {
		gears = inGears;
		speed = 0;
		currentGear = 1;
	}
	
	public int getGears() {
		return gears;
	}
	
	public void pedal() {
		speed++;
	}
	
	public int getSpeed() {
		return speed;
	}
	
	public void brake() {
		speed--;
	}
	
	public void shiftUp() {
		if(currentGear == gears) {
			return;
		}
		
		currentGear++;
	}
	
	public void shiftDown() {
		if(currentGear == 1){
			return;
		}
		
		currentGear--;
	}
	
	public int getCurrentGear() {
		return currentGear;
	}
	
	public String toString() {
		String ret = "";
		
		ret += "gears: " + gears;
		ret += " speed: " + speed;
		ret += " currentGear: " + currentGear;
				
		return ret;
	}
}
